public class Phone implements Comparable<Phone>{
    private Long phoneNum;
    private Integer call;
    private Double balance;

    public Phone() {
    }

    public Phone(Long phoneNum, Integer call, Double balance) {
        this.phoneNum = phoneNum;
        this.call = call;
        this.balance = balance;
    }

    public Long getPhoneNum() {
        return phoneNum;
    }

    public void setPhoneNum(Long phoneNum) {
        this.phoneNum = phoneNum;
    }

    public Integer getCall() {
        return call;
    }

    public void setCall(Integer call) {
        this.call = call;
    }

    public Double getBalance() {
        return balance;
    }

    public void setBalance(Double balance) {
        this.balance = balance;
    }

    @Override
    public String toString() {
        return "Phone{" +
                "phoneNum=" + phoneNum +
                ", call=" + call +
                ", balance=" + balance +
                '}';
    }

    public int compareTo(Phone o) {
        return balance > o.balance? -1 : 1;
    }
}
